@klarkxy/dsh-zhihu 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,41 @@
1
+ The Star And Thank Author License (SATA)
2
+ Version 2.1, September 2026
3
+
4
+ Copyright © 2026 Klarkxy(278370456@qq.com)
5
+
6
+ Project Url: https://github.com/klarkxy/dsh-editor
7
+ https://github.com/klarkxy/sata-license
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in
17
+ all copies or substantial portions of the Software.
18
+
19
+ And wait, one more thing — an invitation, not a condition: it would be best if
20
+ you star/+1/like the project(s) in the project url section above, and thank the
21
+ author(s) in the Copyright section. You may, and arguably you should — but the
22
+ permissions above hold either way, star or no star.
23
+
24
+ Here are some suggested ways:
25
+
26
+ - Email the authors a thank-you letter, and make friends with him/her/them.
27
+ - Report bugs or issues.
28
+ - Tell friends what a wonderful project this is.
29
+ - And, sure, you can just express thanks in your mind without telling the world.
30
+
31
+ Contributors of this project by forking have the option to add his/her name and
32
+ forked project url at copyright and project url sections, but shall not delete
33
+ or modify anything else in these two sections.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
41
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # @klarkxy/dsh-zhihu
2
+
3
+ 独立知乎资料插件。普通 RPC 与可选 Tool 入口分开,可单独使用。包版本独立维护;兼容 DSH `0.1.5-rc.2`。凭据:DSH `ZHIHU_ACCESS_TOKEN`。
4
+
5
+ ## 安装到 DSH Web
6
+
7
+ 需要 Node.js 22 或更高版本,以及 DSH `0.1.5-rc.2` 的 Web profile。
8
+
9
+ ```sh
10
+ dsh plugin --profile web add @klarkxy/dsh-zhihu
11
+ ```
12
+
13
+ 安装后重启 `dsh web`,打开「知乎资料」并配置 `ZHIHU_ACCESS_TOKEN`。模型需要知乎工具时,在所用 `agent.cordis.yml` 的插件列表中加入:
14
+
15
+ ```yaml
16
+ - name: '@klarkxy/dsh-zhihu/tools'
17
+ ```
18
+
19
+ npm 上无 scope 的 `dsh-zhihu` 属于其他维护者,请使用完整的 `@klarkxy/dsh-zhihu` 包名。此包已经编译,安装时无需构建本仓库。
20
+
21
+ ## 入口
22
+
23
+ - Host `zhihu`(feature `zhihu`):`/zhihu`(`src/index.ts`)
24
+ - 官方 Web:`shell.overlay`(id `zhihu`,搜索 / 设置 / 用量 / 知识库)
25
+ - 桌面:`dsh-editor.settings.zhihu` 嵌入设置「知乎资料」(配置 / 用量 / 知识库 / 连接测试),桌面上只有这一个入口(`src/client.ts`)
26
+ - `zhihu-tools`(feature `zhihu-tools`,`dshEditor.inserts`):桌面组合自动加入;工具名未改
27
+
28
+ 桌面 canonical recipe `desktop` 启用 `zhihu` + `zhihu-tools`;`basic` / `smart` / `full` 别名解析同一集合。
29
+
30
+ ## 契约
31
+
32
+ `/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`)。
33
+
34
+ 若当前 profile 已经提供 `webSearchManager`(安装了 `@klarkxy/dsh-web-search-manager`),Host 还会把知乎全网搜索注册为网络搜索后端(id `zhihu-global`),与「知乎资料」共用 `ZHIHU_ACCESS_TOKEN`。未安装管理插件时不注册,也不额外增加依赖。模型侧仍走官方 `web_search`;专用 `zhihu_global_search` 工具不受影响。
35
+
36
+ 在不含空格的目录放置 tarball 后执行:
37
+
38
+ ```powershell
39
+ $packagePath = (Resolve-Path .\klarkxy-dsh-zhihu-0.1.0.tgz).Path.Replace('\', '/')
40
+ dsh plugin --profile web add "file:$packagePath" # klarkxy-dsh-zhihu-0.1.0.tgz
41
+ ```
42
+
43
+ ## 文档
44
+
45
+ [使用者指南](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)
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: zhihu
3
+ name: '@klarkxy/dsh-zhihu'