dsh-querit 1.0.4 → 1.0.6

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.
Files changed (5) hide show
  1. package/README.md +169 -169
  2. package/cordis.patch.yml +24 -24
  3. package/lib/card.js +870 -816
  4. package/package.json +136 -137
  5. package/README-zh.md +0 -128
package/package.json CHANGED
@@ -1,137 +1,136 @@
1
- {
2
- "name": "dsh-querit",
3
- "description": "Querit-backed search and fetch providers for the DeepSeek Harness web capability seam (ctx.web)",
4
- "version": "1.0.4",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./lib/index.d.ts",
11
- "default": "./lib/index.js"
12
- },
13
- "./invariant": {
14
- "types": "./lib/invariant.d.ts",
15
- "default": "./lib/invariant.js"
16
- },
17
- "./client": {
18
- "default": "./lib/card.js"
19
- },
20
- "./package.json": "./package.json"
21
- },
22
- "files": [
23
- "lib",
24
- "cordis.patch.yml",
25
- "README.md",
26
- "README-zh.md",
27
- "LICENSE"
28
- ],
29
- "license": "MIT",
30
- "dsh": {
31
- "bundle": {
32
- "patch": "./cordis.patch.yml"
33
- },
34
- "client": {
35
- "platform": "web",
36
- "inject": [
37
- "@deepseek-ai/dsh-client-connection",
38
- "@deepseek-ai/dsh-client-locale",
39
- "@deepseek-ai/dsh-client-ui-settings",
40
- "@deepseek-ai/dsh-api-remotes"
41
- ]
42
- }
43
- },
44
- "repository": {
45
- "type": "git",
46
- "url": "git+https://github.com/querit-ai/querit-plugins.git"
47
- },
48
- "bugs": {
49
- "url": "https://github.com/querit-ai/querit-plugins/issues"
50
- },
51
- "keywords": [
52
- "dsh-plugin",
53
- "deepseek-harness",
54
- "querit",
55
- "web-search",
56
- "web-fetch"
57
- ],
58
- "scripts": {
59
- "check": "tsc -p tsconfig.check.json",
60
- "build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
61
- "test": "vitest run tests",
62
- "pack:check": "npm pack --dry-run",
63
- "prepack": "npm run check && npm test && npm run build"
64
- },
65
- "peerDependencies": {
66
- "@deepseek-ai/cordis": "^4.0.1",
67
- "@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.6",
68
- "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.6",
69
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
70
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6",
71
- "@deepseek-ai/dsh-credentials": "^0.1.0-rc.6",
72
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
73
- "@deepseek-ai/dsh-launch-environment": "^0.1.0-rc.6",
74
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
75
- "@deepseek-ai/dsh-tool-web": "^0.1.0-rc.6",
76
- "@deepseek-ai/dsh-web": "^0.1.0-rc.6",
77
- "react": "^18.2.0"
78
- },
79
- "peerDependenciesMeta": {
80
- "@deepseek-ai/cordis": {
81
- "optional": true
82
- },
83
- "@deepseek-ai/dsh-credentials": {
84
- "optional": true
85
- },
86
- "@deepseek-ai/dsh-invariants": {
87
- "optional": true
88
- },
89
- "@deepseek-ai/dsh-launch-environment": {
90
- "optional": true
91
- },
92
- "@deepseek-ai/dsh-settings": {
93
- "optional": true
94
- },
95
- "@deepseek-ai/dsh-tool-web": {
96
- "optional": true
97
- },
98
- "@deepseek-ai/dsh-web": {
99
- "optional": true
100
- },
101
- "@deepseek-ai/dsh-api-remotes": {
102
- "optional": true
103
- },
104
- "@deepseek-ai/dsh-client-connection": {
105
- "optional": true
106
- },
107
- "@deepseek-ai/dsh-client-locale": {
108
- "optional": true
109
- },
110
- "@deepseek-ai/dsh-client-ui-settings": {
111
- "optional": true
112
- },
113
- "react": {
114
- "optional": true
115
- }
116
- },
117
- "dependencies": {
118
- "@deepseek-ai/schemastery": "^3.18.1"
119
- },
120
- "devDependencies": {
121
- "@deepseek-ai/cordis": "^4.0.1",
122
- "@deepseek-ai/dsh-credentials": "^0.1.0-rc.6",
123
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
124
- "@deepseek-ai/dsh-launch-environment": "^0.1.0-rc.6",
125
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
126
- "@deepseek-ai/dsh-tool-web": "^0.1.0-rc.6",
127
- "@deepseek-ai/dsh-web": "^0.1.0-rc.6",
128
- "@types/node": "^22.0.0",
129
- "react": "^18.2.0",
130
- "react-dom": "^18.3.1",
131
- "typescript": "^5.9.0",
132
- "vitest": "^4.0.0"
133
- },
134
- "engines": {
135
- "node": ">=22.19.0"
136
- }
137
- }
1
+ {
2
+ "name": "dsh-querit",
3
+ "description": "Querit-backed search and fetch providers for the DeepSeek Harness web capability seam (ctx.web)",
4
+ "version": "1.0.6",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./invariant": {
14
+ "types": "./lib/invariant.d.ts",
15
+ "default": "./lib/invariant.js"
16
+ },
17
+ "./client": {
18
+ "default": "./lib/card.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "files": [
23
+ "lib",
24
+ "cordis.patch.yml",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "license": "MIT",
29
+ "dsh": {
30
+ "bundle": {
31
+ "patch": "./cordis.patch.yml"
32
+ },
33
+ "client": {
34
+ "platform": "web",
35
+ "inject": [
36
+ "@deepseek-ai/dsh-client-connection",
37
+ "@deepseek-ai/dsh-client-locale",
38
+ "@deepseek-ai/dsh-client-ui-settings",
39
+ "@deepseek-ai/dsh-api-remotes"
40
+ ]
41
+ }
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/querit-ai/querit-plugins.git"
46
+ },
47
+ "bugs": {
48
+ "url": "https://github.com/querit-ai/querit-plugins/issues"
49
+ },
50
+ "keywords": [
51
+ "dsh-plugin",
52
+ "deepseek-harness",
53
+ "querit",
54
+ "web-search",
55
+ "web-fetch"
56
+ ],
57
+ "scripts": {
58
+ "check": "tsc -p tsconfig.check.json",
59
+ "build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
60
+ "test": "vitest run tests",
61
+ "pack:check": "npm pack --dry-run",
62
+ "prepack": "npm run check && npm test && npm run build"
63
+ },
64
+ "peerDependencies": {
65
+ "@deepseek-ai/cordis": "^4.0.1",
66
+ "@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.6",
67
+ "@deepseek-ai/dsh-client-connection": "^0.1.0-rc.6",
68
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
69
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6",
70
+ "@deepseek-ai/dsh-credentials": "^0.1.0-rc.6",
71
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
72
+ "@deepseek-ai/dsh-launch-environment": "^0.1.0-rc.6",
73
+ "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
74
+ "@deepseek-ai/dsh-tool-web": "^0.1.0-rc.6",
75
+ "@deepseek-ai/dsh-web": "^0.1.0-rc.6",
76
+ "react": "^18.2.0"
77
+ },
78
+ "peerDependenciesMeta": {
79
+ "@deepseek-ai/cordis": {
80
+ "optional": true
81
+ },
82
+ "@deepseek-ai/dsh-credentials": {
83
+ "optional": true
84
+ },
85
+ "@deepseek-ai/dsh-invariants": {
86
+ "optional": true
87
+ },
88
+ "@deepseek-ai/dsh-launch-environment": {
89
+ "optional": true
90
+ },
91
+ "@deepseek-ai/dsh-settings": {
92
+ "optional": true
93
+ },
94
+ "@deepseek-ai/dsh-tool-web": {
95
+ "optional": true
96
+ },
97
+ "@deepseek-ai/dsh-web": {
98
+ "optional": true
99
+ },
100
+ "@deepseek-ai/dsh-api-remotes": {
101
+ "optional": true
102
+ },
103
+ "@deepseek-ai/dsh-client-connection": {
104
+ "optional": true
105
+ },
106
+ "@deepseek-ai/dsh-client-locale": {
107
+ "optional": true
108
+ },
109
+ "@deepseek-ai/dsh-client-ui-settings": {
110
+ "optional": true
111
+ },
112
+ "react": {
113
+ "optional": true
114
+ }
115
+ },
116
+ "dependencies": {
117
+ "@deepseek-ai/schemastery": "^3.18.1"
118
+ },
119
+ "devDependencies": {
120
+ "@deepseek-ai/cordis": "^4.0.1",
121
+ "@deepseek-ai/dsh-credentials": "^0.1.0-rc.6",
122
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
123
+ "@deepseek-ai/dsh-launch-environment": "^0.1.0-rc.6",
124
+ "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
125
+ "@deepseek-ai/dsh-tool-web": "^0.1.0-rc.6",
126
+ "@deepseek-ai/dsh-web": "^0.1.0-rc.6",
127
+ "@types/node": "^22.0.0",
128
+ "react": "^18.2.0",
129
+ "react-dom": "^18.3.1",
130
+ "typescript": "^5.9.0",
131
+ "vitest": "^4.0.0"
132
+ },
133
+ "engines": {
134
+ "node": ">=22.19.0"
135
+ }
136
+ }
package/README-zh.md DELETED
@@ -1,128 +0,0 @@
1
- # dsh-querit
2
-
3
- English | [中文](./README-zh.md)
4
-
5
- [Querit](https://www.querit.ai) 网页搜索与整页抓取能力,以官方 `ctx.web` 能力接缝(web capability seam)的 provider 形式接入 DeepSeek Harness。它是 [`pi-querit`](https://www.npmjs.com/package/pi-querit) 在 DeepSeek Harness 上的对应物:`web_search`(由 preset 按会话注册)与 `web_fetch`(由本包复用官方 `dsh-tool-web` 注册)工具保持官方形态,本包把它们的后端换成 Querit(`POST https://api.querit.ai/v1/search` 与 `/v1/contents`)。
6
-
7
- 在 [Querit.ai](https://www.querit.ai) 注册即可获得每月 **1,000 次免费调用**,无需信用卡。
8
-
9
- ## 快速开始
10
-
11
- 1. 按「安装与更新」装包即可。v1.0.3 起本包以 *profile bundle* 形式发布:`dsh plugin add` 会自动完成接线(注册插件行并路由接缝),无需手改 `cordis.patch.yml`(「接线」一节说明了它具体应用的内容,以及如何覆盖默认值)。v1.0.4 起 bundle 还会自动禁用随包自带的 DeepSeek 搜索行;卸载本包即可还原。
12
- 2. 按优先级配置 API key:
13
- - 启动环境里的 `QUERIT_API_KEY` 环境变量,或
14
- - 凭据存储(`$DSH_HOME/.credentials.yaml` 加一行 `QUERIT_API_KEY: <key>`,热加载、无需重启),或
15
- - 设置页卡片(v1.0.4+:**设置 → 插件 → 插件配置 → Querit 网页搜索**),或
16
- - `web-search-querit` 行上的 `apiKey` 字面量(最不推荐,密钥不应进组合文件)。
17
- 3. 重启 profile 加载插件行与设置卡片。
18
-
19
- 插件首次加载时若解析不到 key,宿主日志会打印一条一次性警告;在配置 key 之前发起搜索会失败为 `WEB_PROVIDER_CREDENTIAL_MISSING`,错误信息同样写明了以上三种配置方式。
20
-
21
- v1.0.4 起本包还带浏览器端设置卡片:**设置 → 插件 → 插件配置** 会列出「Querit 网页搜索」卡片,可编辑 `web-search-querit` 命名空间(凭据引用名、结果数量、时间范围、语言、国家、域名列表、内容摘录、抓取格式),并能把 API key 直接写入凭据域。卡片写入走的正是 `$DSH_HOME/settings.yaml` 同一条设置通道(见「配置在哪改」)。
22
-
23
- ## 安装与更新
24
-
25
- 包已发布到 npm([`dsh-querit`](https://www.npmjs.com/package/dsh-querit)),正常安装无需任何构建工具链:
26
-
27
- ```bash
28
- dsh plugin --profile web add dsh-querit
29
- ```
30
-
31
- (`dsh plugin` 会把参数转发给 profile 目录下的 pnpm;`web` 换成你的 profile 名。)
32
-
33
- 安装还会同步 profile 的 bundle 列表:由于 `dsh-querit` 声明了 `dsh.bundle`,它会自动加入 `dsh.profile.bundles`,随包分发的补丁层会自动注册插件行、完成接缝路由并禁用 DeepSeek 搜索行(条目见「接线」)。装完重启 profile 即生效。`dsh plugin remove dsh-querit` 会移除整层,bundle 做的一切——包括 DeepSeek 禁用——都会自动还原。手动接线只在 1.0.3 之前的版本或需要覆盖 bundle 默认行值时才有必要。
34
-
35
- ### 更新
36
-
37
- ```bash
38
- dsh plugin --profile web outdated # 看看有没有新版本
39
- dsh plugin --profile web update dsh-querit # 在声明范围内升级
40
- ```
41
-
42
- pnpm 11+ 对"刚发布几分钟"的版本有新鲜度防抖窗口,`outdated`/`update` 可能暂时看不到它。要立即安装某版本就用显式版本号:
43
-
44
- ```bash
45
- dsh plugin --profile web add dsh-querit@<版本号>
46
- ```
47
-
48
- ### 其他安装来源
49
-
50
- ```bash
51
- # GitHub Release 的 tarball(先从 querit-plugins 的 releases 页面下载)
52
- dsh plugin --profile web add ./dsh-querit-<版本号>.tgz
53
- ```
54
-
55
- 仅当没有 pnpm 时兜底:手动解包到 `<profile>/node_modules/dsh-querit`,并在 profile 的 `package.json` 依赖里加上 `"dsh-querit": "<版本号>"`。注意手动解包的目录对 pnpm 不可见,`dsh plugin remove` 不会清理它。
56
-
57
- ## 接线
58
-
59
- v1.0.3 起本包以 profile bundle 形式发布,随包补丁层会自动完成以下全部接线。作为参考,它会应用(包内 `cordis.patch.yml`)如下条目:
60
-
61
- ```yaml
62
- # 添加插件行(同时注册 Querit provider 与 web_fetch 工具)
63
- - insert:
64
- - id: web-search-querit
65
- name: 'dsh-querit'
66
- config:
67
- apiKeyEnv: QUERIT_API_KEY
68
-
69
- # 把接缝的搜索与抓取路由到 Querit
70
- - id: web
71
- config:
72
- searchProvider: querit
73
- fetchProvider: querit
74
-
75
- # 本包就是搜索后端:不再挂载 DeepSeek 搜索行;需要时可覆盖回 disabled: false
76
- - id: web-search-deepseek
77
- disabled: true
78
- ```
79
-
80
- 这就是全部接线:`web_search`(由 preset 按会话注册)与 `web_fetch`(由本包注册)都经由 `ctx.web`,后者现在选择 Querit。补丁会**整体替换**目标行的 `config`,所以上面 `web` 条目把两个键都写全了。bundle 层位于 base 与 app bundle 之后,因此它的 `web` 覆盖生效;若你的 profile 自己的 `cordis.patch.yml` 或 `--patch` 覆盖层更晚出现并重写该行,则以你为准——这也是切回 DeepSeek 搜索(`searchProvider: deepseek-official`)、重新启用 DeepSeek 行(`disabled: false`)或固定自定义默认值的方式。API key 可以通过凭据服务、启动环境的 `QUERIT_API_KEY`、设置卡片、或行内 `apiKey` 字面量提供;改完重启 profile 生效。若某个 preset 自行注册了 `web_fetch`,请把本行 `fetch` 设为 `false`。
81
-
82
- ## 配置项
83
-
84
- | 键 | 默认值 | 说明 |
85
- |---|---|---|
86
- | `apiKey` | 无 | 字面量 Querit API key(优先用 `apiKeyEnv`,避免密钥进配置文件;两者同时设置时 `apiKeyEnv` 环境变量优先) |
87
- | `apiKeyEnv` | `QUERIT_API_KEY` | 每次调用按“启动环境中的同名变量 → 凭据服务 → 行内 `apiKey`”解析;缺失时调用失败为 `WEB_PROVIDER_CREDENTIAL_MISSING` |
88
- | `baseURL` | `https://api.querit.ai` | API 基地址;可被 `$QUERIT_BASE_URL` 环境变量覆盖 |
89
- | `timeoutMs` | `70000` | 单请求超时(毫秒) |
90
- | `count` | `5` | 无 `maxResults` 约束时的结果数(1–20) |
91
- | `timeRange` | 无 | 时间范围:`d7`/`w2`/`m3`/`y1` 或 `YYYY-MM-DDtoYYYY-MM-DD` |
92
- | `countries` | 无 | 国家偏好(17 个有效值) |
93
- | `languages` | 无 | 语言过滤(7 个有效值) |
94
- | `includeDomains` | 无 | 域名**白名单** |
95
- | `excludeDomains` | 无 | 域名**黑名单** |
96
- | `includeContent` | `false` | 请求句子级内容摘录(合并进 snippet) |
97
- | `chunksPerDoc` | `1` | 每结果内容块数(1–3) |
98
- | `fetchFormat` | `markdown` | 抓取格式:`markdown`/`text`/`html` |
99
- | `fetchCrawlTimeout` | `10` | 单页抓取超时(秒,1–60) |
100
- | `fetchMaxChars` | `8000` | 单页内容截断上限(字符) |
101
- | `fetch` | `true` | 是否注册 `web_fetch` 工具(当其他行已注册时设为 `false`) |
102
- | `fetchTimeoutMs` | `30000` | `web_fetch` 工具协作超时预算(毫秒) |
103
- | `fetchMaxOutputChars` | `200000` | 单次 `web_fetch` 渲染输出上限(字符) |
104
-
105
- ### 配置在哪改
106
-
107
- 现在有三个配置入口(设置卡片写入其中两个):
108
-
109
- 1. **设置页卡片**(v1.0.4+):**设置 → 插件 → 插件配置 → Querit 网页搜索**。编辑 `web-search-querit` 命名空间,并可把 API key 写入凭据域;保存即生效、无需重启。
110
- 2. **组合补丁**(上面「接线」的 `cordis.patch.yml`)——改完需重启
111
- 3. **设置文档**——`$DSH_HOME/settings.yaml`(与 `.credentials.yaml` 同一个 dsh 目录)。其中 `web-search-querit:` 段落覆盖行配置并**热加载**(设置服务监听该文件,实测无需重启)。设置卡片通过设置服务写入的就是这份文档:
112
-
113
- ```yaml
114
- web-search-querit:
115
- count: 3
116
- timeRange: m3
117
- languages: [english]
118
- ```
119
-
120
- 每个字段的解析优先级:`settings.yaml` 段落(含卡片写入)> `cordis.patch.yml` 行配置 > schema 默认值。API key 单独放 `.credentials.yaml`(或启动环境变量、或卡片的密钥输入框),不放 `settings.yaml`。
121
-
122
- ## 安全性
123
-
124
- 搜索结果与抓取内容一律视为不可信外部数据;API key 在所有错误输出中脱敏;响应体有大小上限;内容中的终端控制序列与 bidi 控制字符会被清除。
125
-
126
- ## License
127
-
128
- MIT