dsh-zhihu-search 2.1.1 → 2.2.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/README.md +29 -25
- package/README_en.md +29 -25
- package/lib/client.js +25 -5
- package/package.json +36 -36
package/README.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
<img src="icon.svg" alt="dsh-zhihu-search" width="80" height="80">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
<h1 align="center">dsh-zhihu-search</h1>
|
|
7
|
-
</p>
|
|
5
|
+
<h1 align="center">dsh-zhihu-search</h1>
|
|
8
6
|
|
|
9
7
|
<p align="center">
|
|
10
8
|
<img src="assets/banner.svg" alt="dsh-zhihu-search:给 DSH 装上知乎搜索" width="600">
|
|
@@ -16,14 +14,18 @@
|
|
|
16
14
|
|
|
17
15
|
<p>
|
|
18
16
|
<a href="https://developer.zhihu.com/"><img src="https://img.shields.io/badge/Zhihu%20Open%20Platform-Official%20API-0084FF?style=flat&logo=zhihu&logoColor=white" alt="知乎开放平台官方 API"></a>
|
|
19
|
-
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/
|
|
17
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat&logo=deepseek&logoColor=white" alt="由 dsh 驱动"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
<a href="https://github.com/dsh-plugin-lab/dsh-zhihu-search/actions/workflows/ci.yml"><img src="https://github.com/dsh-plugin-lab/dsh-zhihu-search/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
22
|
+
<a href="https://www.npmjs.com/package/dsh-zhihu-search"><img src="https://img.shields.io/npm/v/dsh-zhihu-search.svg?style=flat" alt="npm"></a>
|
|
23
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat" alt="MIT 许可证"></a>
|
|
24
|
+
<a href="https://www.npmjs.com/package/dsh-zhihu-search"><img src="https://img.shields.io/badge/SLSA-Build%20L2-green?logo=slsa&style=flat" alt="SLSA Build L2"></a>
|
|
20
25
|
</p>
|
|
21
26
|
|
|
22
27
|
<p>
|
|
23
|
-
<a href="https://github.com/
|
|
24
|
-
<a href="https://www.npmjs.com/package/dsh-zhihu-search"><img src="https://img.shields.io/npm/v/dsh-zhihu-search.svg" alt="npm"></a>
|
|
25
|
-
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT 许可证"></a>
|
|
26
|
-
<a href="https://www.npmjs.com/package/dsh-zhihu-search"><img src="https://img.shields.io/badge/SLSA-Build%20L2-green?logo=slsa" alt="SLSA Build L2"></a>
|
|
28
|
+
各版本改动 → <a href="https://github.com/dsh-plugin-lab/dsh-zhihu-search/releases">Releases</a>(与 npm 版本一一对应)
|
|
27
29
|
</p>
|
|
28
30
|
|
|
29
31
|
<p>
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
| `zhihu_global_search` | 知乎全网索引搜索,可按域名和时间过滤;结果会混入知乎站内内容 | 查找特定网站上的公开资料 |
|
|
56
58
|
| `zhihu_zhida` | 知乎直答,成体系的综合性回答 | 需要「先检索再总结」的复杂中文问题 |
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
下面三个小节是每个工具的完整参数与能力边界。模型只看到下表中的语义化参数,看不到知乎的原始查询语法。
|
|
59
61
|
|
|
60
62
|
### `zhihu_search` —— 站内检索
|
|
61
63
|
|
|
@@ -105,7 +107,7 @@
|
|
|
105
107
|
|
|
106
108
|
### 前置
|
|
107
109
|
|
|
108
|
-
- **DSH 的区间见 [package.json](package.json) 的 `engines.dsh`** —— 那是唯一真源,它与全部
|
|
110
|
+
- **DSH 的区间见 [package.json](package.json) 的 `engines.dsh`** —— 那是唯一真源,它与全部 `@deepseek-ai/dsh-*` 声明**逐字相同**(不同形状时使用者装到的宿主可能缺接缝,而接缝缺席是**静默**的:配置界面不出现、宿主不报错)。声明面同时承诺了不止一族宿主版本,装哪一族由它说了算。本文件与 [README_en.md](README_en.md) 都不抄那个会漂的值。
|
|
109
111
|
- Node `>= 20`
|
|
110
112
|
|
|
111
113
|
装宿主时**要显式指定版本线**:本家族的 `latest` 标签不可靠(多数 `@deepseek-ai/dsh-*` 包上它指向很早的版本),按默认方式装可能落在声明范围之外 —— 现查 `npm view @deepseek-ai/dsh dist-tags`。
|
|
@@ -116,41 +118,43 @@ npm install -g @deepseek-ai/dsh@next # 本插件承诺支持的线
|
|
|
116
118
|
|
|
117
119
|
兼容性不是推断出来的:每周由 [compat.yml](.github/workflows/compat.yml) 对 `next`(承诺线)与 `alpha`(**已低于我们声明的下限,只作记录**)两条线换包实跑一遍现有测试。当前结论与红了怎么办见 [docs/PUBLISHING.md](docs/PUBLISHING.md) 的「兼容性」。
|
|
118
120
|
|
|
121
|
+
### 从 npm 安装
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
dsh plugin --profile web add dsh-zhihu-search
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`dsh plugin` 会把本包装进 profile 并挂进 `dsh.profile.bundles`。重启 `dsh --profile web` 后生效。
|
|
128
|
+
|
|
119
129
|
### 从源码安装
|
|
120
130
|
|
|
121
131
|
```bash
|
|
122
|
-
git clone https://github.com/
|
|
132
|
+
git clone https://github.com/dsh-plugin-lab/dsh-zhihu-search.git
|
|
123
133
|
cd dsh-zhihu-search
|
|
124
|
-
|
|
134
|
+
pnpm install && pnpm run build
|
|
125
135
|
|
|
126
136
|
dsh plugin --profile web add "$PWD"
|
|
127
137
|
```
|
|
128
138
|
|
|
129
|
-
|
|
139
|
+
同样重启 `dsh --profile web` 生效。
|
|
130
140
|
|
|
131
141
|
⚠️ 上面那步 `npm install` 不能省:`link:` 装法下依赖由仓库自己提供(见 [AGENTS.md](AGENTS.md)),
|
|
132
142
|
漏装则插件显示「未运行」(`ERR_MODULE_NOT_FOUND`)。
|
|
133
143
|
|
|
134
|
-
### 从 npm 安装
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
dsh plugin --profile web add dsh-zhihu-search
|
|
138
|
-
```
|
|
139
|
-
|
|
140
144
|
### 发现与安装
|
|
141
145
|
|
|
142
146
|
- **npm**:[`dsh-zhihu-search`](https://www.npmjs.com/package/dsh-zhihu-search)
|
|
143
|
-
- **GitHub**:[`
|
|
147
|
+
- **GitHub**:[`dsh-plugin-lab/dsh-zhihu-search`](https://github.com/dsh-plugin-lab/dsh-zhihu-search)
|
|
144
148
|
|
|
145
149
|
仓库带有 GitHub topic [`dsh-plugin`](https://github.com/topics/dsh-plugin),插件市场据此自动发现插件。
|
|
146
150
|
|
|
147
151
|
## 版本兼容
|
|
148
152
|
|
|
149
|
-
配置界面注册在宿主插件页的 `plugins.bundle.config` 槽上,分派 `key` 是**本插件的包名**([package.json](package.json) 的 `name`)。这个槽**不把表单递给页面**,所以卡片自己向 `ctx.configForms.get(<loader entry id>)` 取 —— `configForms`
|
|
153
|
+
配置界面注册在宿主插件页的 `plugins.bundle.config` 槽上,分派 `key` 是**本插件的包名**([package.json](package.json) 的 `name`)。这个槽**不把表单递给页面**,所以卡片自己向 `ctx.configForms.get(<loader entry id>)` 取 —— `configForms` 是这个接缝依赖的客户端服务,接缝因此要求宿主的设置接缝达到 `engines.dsh` 声明的**下限版本**;那份声明是唯一事实来源,本文件不抄版本号。
|
|
150
154
|
|
|
151
|
-
- **宿主够新**:插件页 →「已安装(Installed)」组 → **点「知乎检索」进它的详情页**(标题来自 [locale/zh.json](locale/zh.json),中文界面下的显示名;技术名 `dsh-zhihu-search`
|
|
152
|
-
- **宿主更早(没有 `configForms`)**:三个工具照常工作,插件页里**不会出现配置入口** ——
|
|
153
|
-
- **需要就地配置**:把宿主升到 `engines.dsh`
|
|
155
|
+
- **宿主够新**:插件页 →「已安装(Installed)」组 → **点「知乎检索」进它的详情页**(标题来自 [locale/zh.json](locale/zh.json),中文界面下的显示名;技术名 `dsh-zhihu-search` 仍在标题下方),配置区就在描述下面,直接可改 —— **没有多一次 Configure**,密钥与开关都在那里改。
|
|
156
|
+
- **宿主更早(没有 `configForms`)**:三个工具照常工作,插件页里**不会出现配置入口** —— 静默,不报错。这就是分水岭。
|
|
157
|
+
- **需要就地配置**:把宿主升到 `engines.dsh` 声明**覆盖**的那条线 —— 那个范围带上下限、是唯一真源(上限之外的线不在声明范围内);承诺线就是 `next`,装法 `npm install -g @deepseek-ai/dsh@next`;哪条线指向哪个版本现查 `npm view @deepseek-ai/dsh dist-tags`。
|
|
154
158
|
|
|
155
159
|
宿主版本线怎么装见[安装 → 前置](#前置);每周的实测结论与红了怎么办见 [docs/PUBLISHING.md](docs/PUBLISHING.md) 的「兼容性」。
|
|
156
160
|
|
|
@@ -217,7 +221,7 @@ Access Secret 在[知乎开放平台个人中心](https://developer.zhihu.com/pr
|
|
|
217
221
|
|
|
218
222
|
## 贡献
|
|
219
223
|
|
|
220
|
-
|
|
224
|
+
缺陷与需求走仓库 Issues。
|
|
221
225
|
|
|
222
226
|
设计取向:工具参数与返回文本首先是**给模型用的 API**,其次才是给人读的文档 —— 写法规范见 [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) 的「工具描述约定」与「模型可见文本的诚实性」。
|
|
223
227
|
|
package/README_en.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
<img src="icon.svg" alt="dsh-zhihu-search" width="80" height="80">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
<h1 align="center">dsh-zhihu-search</h1>
|
|
7
|
-
</p>
|
|
5
|
+
<h1 align="center">dsh-zhihu-search</h1>
|
|
8
6
|
|
|
9
7
|
<p align="center">
|
|
10
8
|
<img src="assets/banner.svg" alt="dsh-zhihu-search: Equipping DSH with Zhihu search" width="600">
|
|
@@ -16,14 +14,18 @@
|
|
|
16
14
|
|
|
17
15
|
<p>
|
|
18
16
|
<a href="https://developer.zhihu.com/"><img src="https://img.shields.io/badge/Zhihu%20Open%20Platform-Official%20API-0084FF?style=flat&logo=zhihu&logoColor=white" alt="Zhihu Open Platform Official API"></a>
|
|
19
|
-
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/
|
|
17
|
+
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat&logo=deepseek&logoColor=white" alt="powered by dsh"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
<a href="https://github.com/dsh-plugin-lab/dsh-zhihu-search/actions/workflows/ci.yml"><img src="https://github.com/dsh-plugin-lab/dsh-zhihu-search/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
22
|
+
<a href="https://www.npmjs.com/package/dsh-zhihu-search"><img src="https://img.shields.io/npm/v/dsh-zhihu-search.svg?style=flat" alt="npm"></a>
|
|
23
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat" alt="MIT License"></a>
|
|
24
|
+
<a href="https://www.npmjs.com/package/dsh-zhihu-search"><img src="https://img.shields.io/badge/SLSA-Build%20L2-green?logo=slsa&style=flat" alt="SLSA Build L2"></a>
|
|
20
25
|
</p>
|
|
21
26
|
|
|
22
27
|
<p>
|
|
23
|
-
<a href="https://github.com/
|
|
24
|
-
<a href="https://www.npmjs.com/package/dsh-zhihu-search"><img src="https://img.shields.io/npm/v/dsh-zhihu-search.svg" alt="npm"></a>
|
|
25
|
-
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
|
|
26
|
-
<a href="https://www.npmjs.com/package/dsh-zhihu-search"><img src="https://img.shields.io/badge/SLSA-Build%20L2-green?logo=slsa" alt="SLSA Build L2"></a>
|
|
28
|
+
Per-version changes → <a href="https://github.com/dsh-plugin-lab/dsh-zhihu-search/releases">Releases</a> (one-to-one with npm versions)
|
|
27
29
|
</p>
|
|
28
30
|
|
|
29
31
|
<p>
|
|
@@ -55,7 +57,7 @@ Installing adds three tools to the model:
|
|
|
55
57
|
| `zhihu_global_search` | Searches Zhihu's global web index; the results mix in some Zhihu content | Finding material on a specific site |
|
|
56
58
|
| `zhihu_zhida` | Zhihu Zhida: a synthesized answer that pulls a topic together | Complex Chinese questions that need "retrieve, then summarize" |
|
|
57
59
|
|
|
58
|
-
The three sections below are each tool's full parameter set and limits. The model only ever sees the semantic parameters in these tables
|
|
60
|
+
The three sections below are each tool's full parameter set and limits. The model only ever sees the semantic parameters in these tables; it never sees Zhihu's native query syntax.
|
|
59
61
|
|
|
60
62
|
### `zhihu_search` — in-site search
|
|
61
63
|
|
|
@@ -105,7 +107,7 @@ The three sections below are each tool's full parameter set and limits. The mode
|
|
|
105
107
|
|
|
106
108
|
### Requirements
|
|
107
109
|
|
|
108
|
-
- **DSH range**: see `engines.dsh` in [package.json](package.json) — that is the single source of truth, and it is **character-for-character identical** to
|
|
110
|
+
- **DSH range**: see `engines.dsh` in [package.json](package.json) — that is the single source of truth, and it is **character-for-character identical** to every `@deepseek-ai/dsh-*` entry (a mismatch means a Host without the seam this plugin needs, and a missing seam is **silent**: no configuration UI, no error). The declared surface commits to more than one Host family; which one you install is up to it. Neither this file nor [README.md](README.md) copies the value, which drifts.
|
|
109
111
|
- Node `>= 20`
|
|
110
112
|
|
|
111
113
|
Install the Host from an **explicit dist-tag**: `latest` is not trustworthy across this family (on most `@deepseek-ai/dsh-*` packages it points at a much older version), so a default install can land outside the declared range — check it live with `npm view @deepseek-ai/dsh dist-tags`.
|
|
@@ -116,42 +118,44 @@ npm install -g @deepseek-ai/dsh@next # the line this plugin commits to
|
|
|
116
118
|
|
|
117
119
|
Compatibility is measured, not inferred: [compat.yml](.github/workflows/compat.yml) swaps the DSH packages onto the `next` line (the committed one) and the `alpha` line (now **below our declared floor**, kept as a record only) every week, and runs the existing suite. Current results and what to do when a line breaks: [docs/PUBLISHING.md](docs/PUBLISHING.md).
|
|
118
120
|
|
|
121
|
+
### From npm
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
dsh plugin --profile web add dsh-zhihu-search
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`dsh plugin` installs the package into the profile and lists it in `dsh.profile.bundles`. Restart `dsh --profile web` to pick it up.
|
|
128
|
+
|
|
119
129
|
### From source
|
|
120
130
|
|
|
121
131
|
```bash
|
|
122
|
-
git clone https://github.com/
|
|
132
|
+
git clone https://github.com/dsh-plugin-lab/dsh-zhihu-search.git
|
|
123
133
|
cd dsh-zhihu-search
|
|
124
|
-
|
|
134
|
+
pnpm install && pnpm run build
|
|
125
135
|
|
|
126
136
|
dsh plugin --profile web add "$PWD"
|
|
127
137
|
```
|
|
128
138
|
|
|
129
|
-
|
|
139
|
+
The same restart applies.
|
|
130
140
|
|
|
131
141
|
⚠️ The `npm install` above is not optional: under the `link:` form the repository supplies its
|
|
132
142
|
own dependencies (see [AGENTS.md](AGENTS.md)) — skip it and the plugin shows as "not running"
|
|
133
143
|
(`ERR_MODULE_NOT_FOUND`).
|
|
134
144
|
|
|
135
|
-
### From npm
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
dsh plugin --profile web add dsh-zhihu-search
|
|
139
|
-
```
|
|
140
|
-
|
|
141
145
|
### Discovery and install
|
|
142
146
|
|
|
143
147
|
- **npm**: [`dsh-zhihu-search`](https://www.npmjs.com/package/dsh-zhihu-search)
|
|
144
|
-
- **GitHub**: [`
|
|
148
|
+
- **GitHub**: [`dsh-plugin-lab/dsh-zhihu-search`](https://github.com/dsh-plugin-lab/dsh-zhihu-search)
|
|
145
149
|
|
|
146
150
|
The repository carries the GitHub topic [`dsh-plugin`](https://github.com/topics/dsh-plugin), which is how plugin marketplaces discover plugins.
|
|
147
151
|
|
|
148
152
|
## Version compatibility
|
|
149
153
|
|
|
150
|
-
The configuration UI registers into the Host's `plugins.bundle.config` slot, and its dispatch `key` is this plugin's **package name** (the `name` in [package.json](package.json)). That slot does **not** hand the page a form, so the card fetches it itself from `ctx.configForms.get(<loader entry id>)` — `configForms` is
|
|
154
|
+
The configuration UI registers into the Host's `plugins.bundle.config` slot, and its dispatch `key` is this plugin's **package name** (the `name` in [package.json](package.json)). That slot does **not** hand the page a form, so the card fetches it itself from `ctx.configForms.get(<loader entry id>)` — `configForms` is the client service this seam depends on, which is why the seam requires a Host at or above the **lower bound** declared by `engines.dsh`; that declaration is the single source of truth, and this document does not copy version numbers.
|
|
151
155
|
|
|
152
|
-
- **Host is new enough**: **Plugins → Installed → click "Zhihu Search"** to open its details page (that title comes from [locale/en.json](locale/en.json), the name shown on an English UI; the technical name `dsh-zhihu-search` stays right below it) — the configuration section sits
|
|
153
|
-
- **Earlier Host (no `configForms`)**: the three tools keep working, and the Plugins page simply **shows no configuration entry** — silently, with no error. That is the watershed
|
|
154
|
-
- **Want in-place configuration**:
|
|
156
|
+
- **Host is new enough**: **Plugins → Installed → click "Zhihu Search"** to open its details page (that title comes from [locale/en.json](locale/en.json), the name shown on an English UI; the technical name `dsh-zhihu-search` stays right below it) — the configuration section sits right below the description, ready to edit, with **no extra Configure step**. Both the key and the switch are edited there.
|
|
157
|
+
- **Earlier Host (no `configForms`)**: the three tools keep working, and the Plugins page simply **shows no configuration entry** — silently, with no error. That is the watershed.
|
|
158
|
+
- **Want in-place configuration**: install the Host on a line the `engines.dsh` range **covers** — that range carries both ends and is the single source of truth (a line past its ceiling is outside the declaration); the committed line is `next`, so install it with `npm install -g @deepseek-ai/dsh@next`; which line points at which version is one command away: `npm view @deepseek-ai/dsh dist-tags`.
|
|
155
159
|
|
|
156
160
|
How to install the Host from the right line: [Install → Requirements](#requirements). Weekly measurements and what to do when a line breaks: [docs/PUBLISHING.md](docs/PUBLISHING.md).
|
|
157
161
|
|
|
@@ -217,7 +221,7 @@ The card's "Hide native web search (web_search / web_fetch)" switch is off by de
|
|
|
217
221
|
|
|
218
222
|
## Contributing
|
|
219
223
|
|
|
220
|
-
|
|
224
|
+
Bugs and requests go to the repository Issues.
|
|
221
225
|
|
|
222
226
|
Design stance: tool parameters and result text are an **API for the model** first and documentation for humans second — the writing rules live in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) under "Tool description conventions" and "Honesty of model-visible text".
|
|
223
227
|
|
package/lib/client.js
CHANGED
|
@@ -23,12 +23,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
24
|
|
|
25
25
|
// src/client/index.tsx
|
|
26
|
-
var
|
|
27
|
-
__export(
|
|
26
|
+
var index_exports = {};
|
|
27
|
+
__export(index_exports, {
|
|
28
28
|
apply: () => apply,
|
|
29
29
|
inject: () => inject
|
|
30
30
|
});
|
|
31
|
-
module.exports = __toCommonJS(
|
|
31
|
+
module.exports = __toCommonJS(index_exports);
|
|
32
32
|
var import_react = require("react");
|
|
33
33
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
34
34
|
|
|
@@ -211,6 +211,26 @@ var S = {
|
|
|
211
211
|
fontSize: 12,
|
|
212
212
|
lineHeight: 1.5,
|
|
213
213
|
color: "var(--dsw-alias-state-error-primary)"
|
|
214
|
+
},
|
|
215
|
+
// 保存按钮:逐条对齐官方 SettingsForm 的 `.save`(SettingsForm.module.css:32-53)——
|
|
216
|
+
// 官方设置页不用 Button 组件(md 档 36px 高),是这一款紧凑定制按钮。
|
|
217
|
+
// 注意错误色那条例外对这里同样成立:focus ring 令牌取 ui-theme 里真实存在的别名。
|
|
218
|
+
save: {
|
|
219
|
+
appearance: "none",
|
|
220
|
+
border: "1px solid transparent",
|
|
221
|
+
borderRadius: "var(--dsw-radius-md)",
|
|
222
|
+
padding: "5px 14px",
|
|
223
|
+
font: "inherit",
|
|
224
|
+
fontSize: 13,
|
|
225
|
+
lineHeight: 1.5,
|
|
226
|
+
cursor: "pointer",
|
|
227
|
+
background: "var(--dsw-alias-label-primary)",
|
|
228
|
+
color: "var(--dsw-alias-bg-layer-3)"
|
|
229
|
+
},
|
|
230
|
+
// 官方 `.save:disabled` 的 opacity 0.4 与默认光标,等价改写成对象形式。
|
|
231
|
+
saveDisabled: {
|
|
232
|
+
opacity: 0.4,
|
|
233
|
+
cursor: "default"
|
|
214
234
|
}
|
|
215
235
|
};
|
|
216
236
|
function unrefTimer(timer) {
|
|
@@ -361,10 +381,10 @@ function ZhihuCard({ form, store, trackSavedRef, t }) {
|
|
|
361
381
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: S.footer, children: [
|
|
362
382
|
failed !== "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: S.failed, role: "status", children: failed }) : null,
|
|
363
383
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
364
|
-
|
|
384
|
+
"button",
|
|
365
385
|
{
|
|
366
386
|
type: "button",
|
|
367
|
-
|
|
387
|
+
style: blocked ? { ...S.save, ...S.saveDisabled } : S.save,
|
|
368
388
|
disabled: blocked,
|
|
369
389
|
onClick: () => {
|
|
370
390
|
void save();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-zhihu-search",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Zhihu in-site search, global web search, and Zhida answers for the model, over the official Zhihu Open Platform API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -12,15 +12,16 @@
|
|
|
12
12
|
"tool"
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
|
+
"author": "zlZayn",
|
|
15
16
|
"icon": "./icon.svg",
|
|
16
17
|
"repository": {
|
|
17
18
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/
|
|
19
|
+
"url": "git+https://github.com/dsh-plugin-lab/dsh-zhihu-search.git"
|
|
19
20
|
},
|
|
20
21
|
"bugs": {
|
|
21
|
-
"url": "https://github.com/
|
|
22
|
+
"url": "https://github.com/dsh-plugin-lab/dsh-zhihu-search/issues"
|
|
22
23
|
},
|
|
23
|
-
"homepage": "https://github.com/
|
|
24
|
+
"homepage": "https://github.com/dsh-plugin-lab/dsh-zhihu-search#readme",
|
|
24
25
|
"type": "module",
|
|
25
26
|
"main": "./lib/index.js",
|
|
26
27
|
"types": "./lib/index.d.ts",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
],
|
|
49
50
|
"engines": {
|
|
50
51
|
"node": ">=20",
|
|
51
|
-
"dsh": "
|
|
52
|
+
"dsh": "^0.1.7-rc.1 || ^0.2.1-rc.1"
|
|
52
53
|
},
|
|
53
54
|
"dsh": {
|
|
54
55
|
"bundle": {
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"scripts": {
|
|
65
66
|
"build": "tsc && tsc -p tsconfig.client.json && node scripts/build-client.mjs",
|
|
66
67
|
"typecheck": "tsc -p tsconfig.test.json --noEmit && tsc -p tsconfig.client.json --noEmit",
|
|
67
|
-
"test": "
|
|
68
|
+
"test": "pnpm run build && vitest run",
|
|
68
69
|
"test:watch": "vitest",
|
|
69
70
|
"test:contract": "vitest run --config vitest.contract.config.ts",
|
|
70
71
|
"lint": "eslint .",
|
|
@@ -72,19 +73,19 @@
|
|
|
72
73
|
"format:check": "prettier --check .",
|
|
73
74
|
"check:release": "node scripts/check-release.mjs",
|
|
74
75
|
"check:declaration": "node scripts/check-declaration.mjs",
|
|
75
|
-
"prepare": "
|
|
76
|
+
"prepare": "pnpm run build"
|
|
76
77
|
},
|
|
77
78
|
"peerDependencies": {
|
|
78
79
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
79
|
-
"@deepseek-ai/dsh-client-locale": "
|
|
80
|
-
"@deepseek-ai/dsh-client-ui-primitives": "
|
|
81
|
-
"@deepseek-ai/dsh-client-ui-settings": "
|
|
82
|
-
"@deepseek-ai/dsh-client-ui-slots": "
|
|
83
|
-
"@deepseek-ai/dsh-credentials": "
|
|
84
|
-
"@deepseek-ai/dsh-llm": "
|
|
85
|
-
"@deepseek-ai/dsh-settings": "
|
|
86
|
-
"@deepseek-ai/dsh-tools": "
|
|
87
|
-
"@deepseek-ai/dsh-util-values": "
|
|
80
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
81
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
82
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
83
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
84
|
+
"@deepseek-ai/dsh-credentials": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
85
|
+
"@deepseek-ai/dsh-llm": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
86
|
+
"@deepseek-ai/dsh-settings": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
87
|
+
"@deepseek-ai/dsh-tools": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
88
|
+
"@deepseek-ai/dsh-util-values": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
88
89
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
89
90
|
"react": "^18.3.1",
|
|
90
91
|
"react-dom": "^18.3.1"
|
|
@@ -92,30 +93,29 @@
|
|
|
92
93
|
"devDependencies": {
|
|
93
94
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
94
95
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.4",
|
|
95
|
-
"@deepseek-ai/dsh-agent": "
|
|
96
|
-
"@deepseek-ai/dsh-client-locale": "
|
|
97
|
-
"@deepseek-ai/dsh-client-ui-plugin-manager": "
|
|
98
|
-
"@deepseek-ai/dsh-client-ui-primitives": "
|
|
99
|
-
"@deepseek-ai/dsh-client-ui-renderer": "
|
|
100
|
-
"@deepseek-ai/dsh-client-ui-settings": "
|
|
101
|
-
"@deepseek-ai/dsh-client-ui-slots": "
|
|
102
|
-
"@deepseek-ai/dsh-credentials": "
|
|
103
|
-
"@deepseek-ai/dsh-
|
|
104
|
-
"@deepseek-ai/dsh-
|
|
105
|
-
"@deepseek-ai/dsh-
|
|
106
|
-
"@deepseek-ai/dsh-session": "
|
|
107
|
-
"@deepseek-ai/dsh-
|
|
108
|
-
"@deepseek-ai/dsh-
|
|
109
|
-
"@deepseek-ai/dsh-
|
|
110
|
-
"@deepseek-ai/dsh-
|
|
111
|
-
"@deepseek-ai/dsh-
|
|
112
|
-
"@deepseek-ai/dsh-util-values": ">=0.1.7-rc.1 <0.1.8-0 || >=0.2.0-rc.1 <0.2.1-0",
|
|
96
|
+
"@deepseek-ai/dsh-agent": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
97
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
98
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
99
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
100
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
101
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
102
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
103
|
+
"@deepseek-ai/dsh-credentials": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
104
|
+
"@deepseek-ai/dsh-llm": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
105
|
+
"@deepseek-ai/dsh-scope": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
106
|
+
"@deepseek-ai/dsh-session": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
107
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
108
|
+
"@deepseek-ai/dsh-settings": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
109
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
110
|
+
"@deepseek-ai/dsh-tools": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
111
|
+
"@deepseek-ai/dsh-user-approval": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
112
|
+
"@deepseek-ai/dsh-util-values": "^0.1.7-rc.1 || ^0.2.1-rc.1",
|
|
113
113
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
114
114
|
"@eslint/js": "^10.0.1",
|
|
115
115
|
"@types/node": "^20.0.0",
|
|
116
116
|
"@types/react": "~18.3.1",
|
|
117
117
|
"@types/react-dom": "~18.3.1",
|
|
118
|
-
"esbuild": "^0.
|
|
118
|
+
"esbuild": "^0.28.2",
|
|
119
119
|
"eslint": "^10.11.0",
|
|
120
120
|
"eslint-config-prettier": "^10.1.8",
|
|
121
121
|
"globals": "^17.12.0",
|
|
@@ -124,6 +124,6 @@
|
|
|
124
124
|
"react-dom": "^18.3.1",
|
|
125
125
|
"typescript": "^5.4.0",
|
|
126
126
|
"typescript-eslint": "^8.70.1",
|
|
127
|
-
"vitest": "^
|
|
127
|
+
"vitest": "^4.1.11"
|
|
128
128
|
}
|
|
129
129
|
}
|